﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CSharpDesign.DAL;
using CSharpDesign.Scripts;
using CSharpDesign.BLL;

namespace CSharpDesign
{
    public partial class MMPwd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = " 水果商店";
            if (!IsPostBack)
            {
                if (Session["UserId"] == null)
                {
                    Alert.AlertAndRedirect("对不起您还没有登录", "Default.aspx");
                }
                else
                { }


            }
        }

        /// <summary>
        /// 检验密码
        /// </summary>
        protected void Button1_Click(object sender, EventArgs e)
        {
            string userid = Session["UserId"].ToString();
            string textpwd1 = txtpwd1.Text;
            string Username = Session["UserId"].ToString();
            string txtpwd = txtpwd2.Text.ToString();
            try
            {
                MMPwdService mM = new MMPwdService();
                mM.chkpwds(userid, textpwd1, Username, txtpwd);
                LabelWarningMessage.Text = "修改成功！";
            }
            catch (Exception ex)
            {
                LabelWarningMessage.Text = ex.Message;
            }
        }
    }

}